import pandas as pd
# 解决数据输出时列名不对齐问题
pd.set_option('display.unicode.east_asian_width',True)

data = [[102,345,657],[768,888,990],[12,38,466], [662,384,766],[454,787]]
name = ['jack','rose','zs','ls','dark']
columns = ['java','python','c++']
df = pd.DataFrame(data=data , index=name,columns=columns)

# df['c'] = [12,34,56,78,54]
# 在df后面新增
# df.loc[:,'c']=[11,22,33,44,55]
# 在指定位置增加数据
# c = [11,22,33,44,55]
# df.insert(1,'c',c)
index = ['ww','zl','xm']
df_insert = pd.DataFrame({
    'java':[11,22,33],
    'c': [77, 88, 99],
    'c++':[44,55,66]
},index=index)
df1 = df._append(df_insert)
print(df1)



